package com.sx.gongzhong.pest;

import android.content.Context;

import com.sx.gongzhong.model.HeadParamBean;
import com.sx.gongzhong.model.LetterBean;
import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.model.BasePageListBean;
import com.sx.gongzhong.view.MyLettersListView;

import java.util.Map;

/**我的信访举报 列表
 * Created by admin on 2018/1/15.
 */

public class MyLettersListPest {
    private MyLettersListView myLettersListView;

    public MyLettersListPest(MyLettersListView myLettersListView) {
        this.myLettersListView = myLettersListView;
    }

    public void getMyLettersListData(Context context, int page, int rows) {
        Map<String,Object> map = HeadParamBean.getHead();
        map.put("sourcesState",0);
        map.put("page",page);
        map.put("rows",rows);
        new ApiManager().getMyLettersListData(map, new BaseCallBack<ReplyUserBean.BaseResult<BasePageListBean<LetterBean>>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<BasePageListBean<LetterBean>> response) {
                myLettersListView.getSuccess(response.data.rows,response.data.total);
            }
            @Override
            public void onFailures(String message) {
                myLettersListView.showError(message);
            }
        });
    }
}
